package com.smartpro.mis.modular.system.dao;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.smartpro.mis.modular.system.model.Orders;
import com.smartpro.mis.modular.system.model.Product;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author mengiy123
 * @since 2019-04-10
 */
public interface ProductMapper extends BaseMapper<Product> {
    @Options(useGeneratedKeys = true, keyProperty = "productID", keyColumn = "productID") // id自动增长
     int insertID(@Param("product") Product product);

    List<Map<String,Object>> getProductList(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("start") Integer start,@Param("num") Integer num);

    List<Map<String,Object>> getHomeProductList(@Param("beginTime") String beginTime, @Param("endTime") String endTime,@Param("onHomepage")Integer onHomepage, @Param("start") Integer start,@Param("num") Integer num);

    List<Product> selectListByPage(@Param("page") Pagination page, @Param("start") int start, @Param("num") int num);
}
